package models.mappers;

import java.util.List;
import java.util.Map;

import models.Department;
import models.User;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

import vos.DepartSearchVo;


public interface DepartmentMapper {
	/**
	 * 统计返回页面的总条数
	 *
	 * @Title: countDepartment 
	 * @param departmentCode 部门编号
	 * @param departmentName 部门名称
	 * @return
	 * @return: long
	 */
	long countDepartment(DepartSearchVo vo);
	/**
	 * 获取部门记录
	 *
	 * @Title: listDepartment 
	 * @param page 页码
	 * @param pagesize 页大小
	 * @param departmentCode 部门编码
	 * @param departmentName 部门名称
	 * @return
	 * @return: List<Department> 部门列表
	 */
	List<Department> listDepartment(DepartSearchVo vo);
	/**
	 * 启用部门
	 *
	 * @Title: enableDepartment 
	 * @param id
	 * @return
	 * @return: Object
	 */
	void enableDepartment(Map<String,List<String>> map);
	/**
	 * 启用部门
	 *
	 * @Title: disableDepartment 
	 * @param id
	 * @return
	 * @return: Object
	 */
	void disableDepartment(Map<String, List<String>> map);
	/**
	 * 删除部门
	 *
	 * @Title: disableDepartment 
	 * @param id
	 * @return
	 * @return: Object
	 */
	void betchDeleteDepartment(Map<String, List<String>> map);
	/**
	 * 根据id查询记录
	 *
	 * @Title: findByIdDepartment 
	 * @param id
	 * @return
	 * @return: Department
	 */
	@Select("select * from "
			+ Department.TABLE_NAME
			+" where departmentid=#{id}")
	Department findByIdDepartment(String id);
	/**
	 * 根据id删除记录
	 *
	 * @Title: deleteByIdDepartment 
	 * @param id 部门id
	 * @return: void
	 */
	@Delete("delete from "
			+ Department.TABLE_NAME
			+ " where departmentid=#{id}")
	void deleteByIdDepartment(String id);
	/**
	 * 根据code查询部门
	 *
	 * @Title: findByCodeDepartment 
	 * @param departmentCode 部门编号
	 * @return
	 * @return: Department
	 */
	@Select("select * from "
			+ Department.TABLE_NAME
			+" where departmentcode=#{departmentCode}")
	Department findByCodeDepartment(String departmentCode);
}
